{layout name="../common/master"/}

<script src="__PUBLIC__/uploadify/jquery.uploadify.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/uploadify/uploadify.css">

<div id="right">
    <h4 style="border-bottom: 1px solid #ccc;padding-bottom: 3px">发放优惠券</h4>
    <div id="app">
        <form action="javascript:;" method="post" role="form" class="col-lg-6">
            <div class="form-group">
                <label for="">发送的优惠券</label>
                <select name="coupon" id="inputID" class="form-control">
                    <option value=""> -- Select One --</option>
                    {foreach $coupon as $vo}
                     <option value="{$vo['id']}">{$vo['name']}</option>
                    {/foreach}
                </select>
            </div>

            <div class="form-group">
                <label for="">用户性别</label>
                <div class="radio">
                    <label>
                        <input type="radio" name="gender" value="1">
                        男
                    </label>
                    <label>
                        <input type="radio" name="gender" value="2">
                        女
                    </label>
                    <label>
                        <input type="radio" name="gender" value="11" checked="checked">
                        所有性别
                    </label>
                </div>
            </div>
            <div class="form-group">
                <label for="">用户年龄</label>
                <input name="upage" type="text" id="" onclick="WdatePicker({startDate:'1950-11-01',alwaysUseStartDate:true})"/>
                <input name="downage" type="text" id="" onclick="WdatePicker({startDate:'1950-11-01',alwaysUseStartDate:true})"/>
            </div>

            <div class="form-group">
                <label for="">用户注册时间</label>
                <input name="upsign" type="text" id="" onclick="WdatePicker({startDate:'2017-11-01',alwaysUseStartDate:true})"/>
                <input name="downsign" type="text" id="" onclick="WdatePicker({startDate:'2017-11-01',alwaysUseStartDate:true})"/>
            </div>

           <!--<div class="form-group">-->
                <!--<label for="">用户认证时间</label>-->
               <!--<input name="upcheck" type="text" id="" onclick="WdatePicker({startDate:'2017-11-01',alwaysUseStartDate:true})"/>-->
               <!--<input name="downcheck" type="text" id="" onclick="WdatePicker({startDate:'2017-11-01',alwaysUseStartDate:true})"/>-->
            <!--</div>-->
            <button type="submit" id="form_submit" class="btn btn-primary">发放</button>
        </form>
    </div>
</div>
<script>
    $("#form_submit").click(function () {
        var data=$('form').serialize();
        $.post("{:URL('home/Coupon/couponToUser')}",data,function(res){
           if(res.code == 0){
               layer.msg("发放成功");
               location.href="{:URL('home/Coupon/toUser')}";
           }else if(res.code == 4){
               layer.msg(res.msg,function(){});
           }
        })
    })
</script>


<script type="text/javascript" src="__PUBLIC__/home/tuo/DatePicker/WdatePicker.js"></script>

